home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / a_utils / _archvrs / unix / zoo21src.lha / zoo / options.h < prev    next >
C/C++ Source or Header  |  1992-11-20  |  10KB  |  412 lines

  1. /* @(#) options.h 2.22 88/08/24 15:27:36 */
  2.  
  3. /*
  4. The contents of this file are hereby released to the public domain.
  5.                            -- Rahul Dhesi 1991/07/06
  6.  
  7. For documentation about this file, see options.doc.
  8. */
  9.  
  10. #define ZOO                             /* always defined */
  11. #define PORTABLE                /* always defined */
  12. #define ZOOCOMMENT      /* always defined */
  13.  
  14.  
  15. /***********************************************************************/
  16. /* SYSTEM V (should be compatible with most releases)                  */
  17. /***********************************************************************/
  18.  
  19. #ifdef SYS_V
  20. #define FILTER
  21. #define IO_MACROS
  22. #define EXISTS(f)               (access(f, 00) == 0)
  23. #define FNLIMIT 14
  24. #define CHEKDIR
  25. #define NIXTIME
  26. #define NIXFNAME
  27. #define NEEDCTYP
  28. #define NOENUM
  29. #define REN_LINK
  30. #define SETBUF
  31. #define GETTZ
  32. #define FATTR
  33. #define T_SIGNAL        void
  34. #define VARARGS
  35. #define NEED_MEMMOVE
  36. /* #define NEED_MEMCPY */
  37. #define T_UINT16                unsigned short          /* must be 16 bit unsigned */
  38. #define HAVE_ISATTY
  39. /* #define NEED_VPRINTF */
  40. #endif /* SYS_V */
  41.  
  42. /***********************************************************************/
  43. /* Turbo C++ 1.0 under MS-DOS                                          */
  44. /***********************************************************************/
  45.  
  46. #ifdef TURBOC
  47. #undef PORTABLE
  48. #define ANSI_HDRS
  49. #define USE_ASCII
  50. #define SPECINIT
  51. #define SPECEXIT
  52. #define PURIFY
  53. #define DISK_CH ':'
  54. #define IGNORECASE
  55. #define WILDCARD "*.*"
  56. #define FOLD
  57. #define FORCESLASH
  58. #define FNLIMIT 12
  59. #define CUR_DIR "."
  60. #define PATH_SEP ":/\\"
  61. #define EXT_SEP  ":/\\."
  62. #define SETMODE
  63. /* 0x8000 and 0x4000 taken from <fcntl.h> for Turbo C */
  64. #define MODE_BIN(f)      setmode(fileno(f), 0x8000)
  65. #define MODE_TEXT(f)     setmode(fileno(f), 0x4000)
  66. #define NEED_STDIO
  67. #define ANSI_PROTO
  68. #define VOIDPTR         void *
  69. #define REN_STDC
  70. #define STDARG
  71. #define T_UINT16                unsigned short          /* must be 16 bit unsigned */
  72. /* #define UNBUF_IO */
  73. /* #define UNBUF_LIMIT  512 */
  74. #define  T_SIGNAL void
  75. #define DIRECT_CONVERT
  76. #define STDARG
  77. #define CHECK_BREAK
  78. #define check_break kbhit
  79. #define HAVE_ISATTY
  80. #ifdef  PORTABLE                /* for testing only */
  81. # define SPECNEXT
  82. # define NIXTIME
  83. # undef  WILDCARD
  84. #endif
  85. #endif /* TURBOC */
  86.  
  87. /***********************************************************************/
  88. /* Older BSD 4.3 and most derivatives                                  */
  89. /***********************************************************************/
  90.  
  91. #ifdef BSD4_3
  92. #define NOSTRCHR /* not really needed for 4.3BSD */
  93. #define FILTER
  94. #define IO_MACROS
  95. #define EXISTS(f)               (access(f, 00) == 0)
  96. #define FNLIMIT 1023
  97. #define CHEKDIR
  98. #define NIXTIME
  99. #define NIXFNAME
  100. #define NEEDCTYP
  101. #define NOENUM
  102. #define REN_STDC
  103. #define SETBUF
  104. #define GETTZ
  105. #define FATTR
  106. #define T_SIGNAL        int
  107. #define VARARGS
  108. #define NEED_MEMMOVE
  109. #define T_UINT16                unsigned short          /* must be 16 bit unsigned */
  110. #define HAVE_ISATTY
  111. #define NEED_VPRINTF            /* older BSDs only; newer ones have vprintf */
  112. #endif /* BSD4_3 */
  113.  
  114. /*  Ultrix 4.1 */
  115. #ifdef ULTRIX
  116. #define NO_STDIO_FN     /* avoid declaring certain stdio functions */
  117. #define NOSTRCHR /* needed? */
  118. #define FILTER
  119. #define IO_MACROS
  120. #define EXISTS(f)               (access(f, 00) == 0)
  121. #define FNLIMIT 1023
  122. #define CHEKDIR
  123. #define NIXTIME
  124. #define NIXFNAME
  125. #define NEEDCTYP
  126. #define NOENUM
  127. #define REN_STDC
  128. #define SETBUF
  129. #define GETTZ
  130. #define FATTR
  131. #define T_SIGNAL        void
  132. #define VARARGS
  133. #define NEED_MEMMOVE
  134. #define T_UINT16        unsigned short  /* must be 16 bit unsigned */
  135. #define HAVE_ISATTY
  136. /* #define NEED_VPRINTF */
  137. #define BSD4_3          /* for I/O definitions */
  138. #endif /* ULTRIX */
  139.  
  140. /***********************************************************************/
  141. /* Newer BSD 4.4 (projected)                                           */
  142. /***********************************************************************/
  143.  
  144. #ifdef BSD4_4
  145. /* #define NOSTRCHR */
  146. #define FILTER
  147. #define IO_MACROS
  148. #define EXISTS(f)               (access(f, 00) == 0)
  149. #define FNLIMIT 1023
  150. #define CHEKDIR
  151. #define NIXTIME
  152. #define NIXFNAME
  153. #define NEEDCTYP
  154. /* #define NOENUM */
  155. #define REN_STDC
  156. #define SETBUF
  157. #define GETTZ
  158. #define FATTR
  159. #define T_SIGNAL        void
  160. /* #define VARARGS */
  161. /* #define NEED_MEMMOVE */
  162. #define T_UINT16                unsigned short          /* must be 16 bit unsigned */
  163. #define HAVE_ISATTY
  164. /* #define NEED_VPRINTF */
  165. #endif /* BSD4_4 */
  166.  
  167. /***********************************************************************/
  168. /* VAX/VMS version 5.3 or so                                           */
  169. /***********************************************************************/
  170.  
  171. #ifdef VMS
  172.  
  173. /*
  174. Select VMS pre-4.6 or later next line.  Pre-4.6 library does not have
  175. rename() and memset() so zoo defines its own;  4.6 has these, so we
  176. must use them, else VMS library functions will conflict with our
  177. own.
  178. */
  179. # if 0          /* Make this 1 for VMS version 4.5 or earlier */
  180. #  define NEED_VMS_RENAME       /* used in vms.c */
  181. #  define NEED_MEMSET
  182. # endif
  183. #define REN_STDC
  184. #define IO_MACROS
  185. #define SPEC_WILD
  186. #define EXT_ANYWAY
  187. #define VER_CH ';'
  188. #define SPECEXIT
  189. #define CHEKUDIR
  190. #define FNLIMIT 78
  191. #define DIR_SEP '.'  /* separates dir fields */
  192. #define DISK_CH ':'
  193. #define DIR_LBRACK "[" /* left bracketing symbol dir dir name */
  194. #define PATH_CH "]"
  195. #define PATH_SEP ":]"
  196. #define EXT_SEP ":]."
  197. #define CUR_DIR "."
  198. #define NIXTIME
  199. #define NEEDCTYP
  200. #define NOENUM
  201. #define IGNORECASE
  202. #define SPECMOD
  203. #define SPECNEXT
  204. #define WILDCARD "*.*"
  205. #define FOLD
  206. #define NO_STDIO_FN
  207. #define T_SIGNAL        void
  208. #define T_UINT16                unsigned short          /* must be 16 bit unsigned */
  209. #define VARARGS
  210. #endif /* VMS */
  211.  
  212. /***********************************************************************/
  213. /* AMIGA, SOME VERSION -- NOT TESTED, MAY NEED PORTING                 */
  214. /***********************************************************************/
  215.  
  216. #ifdef MCH_AMIGA
  217. #define PURIFY
  218. #define DISK_CH ':'
  219. #define SPECNEXT
  220. #define WILDCARD "*"
  221. #define IGNORECASE
  222. #define FNLIMIT 30
  223. #define NEEDCTYP
  224. #define CUR_DIR "."
  225. #define PATH_SEP ":/"
  226. #define EXT_SEP  ":/."
  227. #define NOSIGNAL
  228. #define REN_STDC
  229. #define NOENUM
  230. #define SETBUF
  231. #define CHEKUDIR
  232. #define GETUTIME
  233. #define NIXTIME
  234. #endif
  235.  
  236. /***********************************************************************/
  237. /* GENERIC **IX SYSTEM -- GOOD STARTING POINT FOR YOURS                */
  238. /***********************************************************************/
  239.  
  240. #ifdef GENERIC
  241. /* #define SPECNEXT */
  242. /* #define IGNORECASE */
  243. #define FNLIMIT 14
  244. #define NEEDCTYP
  245. #define CUR_DIR "."
  246. #define PATH_SEP "/"
  247. #define EXT_SEP  "/."
  248. /* #define NOSIGNAL */
  249. /* REN_LINK is UNIX-specific.  Can't find a generic rename() function */
  250. #define REN_LINK
  251. #define NOENUM
  252. /* #define SETBUF */
  253. #define CHEKDIR
  254. #define NIXTIME
  255. #define HAVE_ISATTY
  256. #define NEED_MEMMOVE
  257. #endif /* GENERIC */
  258.  
  259. #ifdef TOS
  260. #ifdef __GNUC__
  261. #  include <stdlib.h>
  262. #  include <stddef.h>
  263. #  include <string.h>
  264. #  include <unistd.h>
  265. #  include <stdio.h>
  266. #  include <memory.h>
  267. #  include <limits.h>
  268. #  define ANSI_PROTO
  269. #  define ANSI_HDRS
  270. #  define VOIDPTR void *
  271. #  define GETTZ
  272. #  define SETMODE
  273. #  define MODE_BIN(Z)     (fflush(Z), Z->_flag |= _IOBIN)
  274. #  define MODE_TEXT(Z)    (fflush(Z), Z->_flag &= ~_IOBIN)
  275. #  define NO_STDIO_FN
  276. #  ifndef _LIB_NAME_MAX
  277. #    define _LIB_NAME_MAX 12
  278. #  endif
  279. #  define FNLIMIT         _LIB_NAME_MAX
  280. #  define T_SIGNAL        void
  281. #  define FATTR
  282. #else  /* !__GNUC__ */
  283. #  define NOSIGNAL
  284. #  define FNLIMIT 12
  285. #endif /* __GNUC__ */
  286.  
  287. #define DISK_CH ':'
  288. #define EXISTS(a)       (access(a, 0) == 0)
  289. #define FOLD               /* dont define this if you use mixed case UNIXMODE */
  290. #define PURIFY
  291. #define NEEDCTYP
  292. #define FORCESLASH
  293. #define REN_STDC
  294. #define SETBUF
  295. #define VER_DISPLAY ";"
  296. #define VER_INPUT ":;"
  297. #define CHEKDIR
  298. #define NIXFNAME
  299. #define NIXTIME
  300. #define IO_MACROS
  301. #define SPECEXIT
  302. #define STDARG
  303. #define T_UINT16        unsigned short
  304. #define NEED_MEMMOVE
  305. #define SZ_SCREEN       25
  306. #endif /* TOS */
  307.  
  308. /***********************************************************************/
  309. /* REST OF THIS FILE SHOULD NOT NEED ANY CHANGES                       */
  310. /***********************************************************************/
  311.  
  312. /***********************************************************************/
  313. /*  Common filename conventions for **IX systems                       */
  314. /***********************************************************************/
  315.  
  316. #ifdef NIXFNAME
  317. #define CUR_DIR "."
  318. #define PATH_SEP "/"
  319. #define EXT_CH '.'
  320. #define EXT_SEP  "/."
  321. #define EXT_DFLT ".zoo"
  322. #endif
  323.  
  324. /* Compensate for strchr/index differences */
  325. #ifdef NOSTRCHR
  326. #define strchr  index
  327. #define strrchr rindex
  328. #endif
  329.  
  330. /* let non-**IX lints under **IX work (see makefile) */
  331. #ifdef CROSS_LINT
  332. # undef ANSI_HDRS
  333. # undef ANSI_PROTO
  334. # ifdef STDARG
  335. #  undef STDARG
  336. #  define VARARGS
  337. # endif /* STDARG */
  338. #endif
  339.  
  340. /* assume certain defaults */
  341. #ifndef VOIDPTR
  342. # define VOIDPTR   char *
  343. #endif
  344.  
  345. #ifndef VER_DISPLAY
  346. # define VER_DISPLAY ";"
  347. #endif
  348. #ifndef VER_INPUT
  349. # define VER_INPUT ":;"
  350. #endif
  351. #ifndef PATH_CH
  352. # define PATH_CH "/"
  353. #endif
  354. #ifndef EXT_CH
  355. # define EXT_CH '.'
  356. #endif
  357. #ifndef EXT_DFLT
  358. # define EXT_DFLT ".zoo"
  359. #endif
  360.  
  361. #ifndef STDARG
  362. # ifndef VARARGS
  363. #  define VARARGS
  364. # endif
  365. #endif
  366.  
  367. #ifndef T_SIGNAL
  368. # define T_SIGNAL               int
  369. #endif
  370.  
  371. #ifdef STDARG
  372. # ifdef VARARGS
  373. # include "DO NOT DEFINE BOTH STDARG AND VARARGS"
  374. # endif
  375. #endif
  376.  
  377. /* We supply a default for T_UINT16 if it is not defined.  But this
  378. value is critical, so we compile in a runtime check. */
  379.  
  380. #ifndef T_UINT16
  381. # define T_UINT16       unsigned short
  382. # define CHECK_TUINT    /* will do runtime check for correct size */
  383. #endif
  384.  
  385. /* ANSI compatibility in declarations -- see zoofns.h for usage */
  386. #ifndef PARMS
  387. # ifdef ANSI_PROTO
  388. #  define PARMS(x)              x
  389. # else
  390. #  define PARMS(x)              ()
  391. # endif
  392. #endif
  393.  
  394. #ifdef __GNUC__
  395. extern unsigned int crccode;
  396. extern unsigned int crctab[];
  397. static void addbfcrc(char *buffer, int count);
  398.  
  399. inline static void addbfcrc(buffer,count)
  400. char *buffer;
  401. int count;
  402.  
  403. {
  404.    unsigned int localcrc;
  405.    localcrc = crccode;
  406.  
  407.    for (; count--; )
  408.       localcrc = (localcrc>>8) ^ crctab[(localcrc ^ (*buffer++)) & 0x00ff];
  409.    crccode = localcrc;
  410. }
  411. #endif
  412.